package com.briup.estore.service;

import com.briup.estore.bean.ext.AddressExtend;
import com.briup.estore.mapper.AddressMapper;
import com.briup.estore.utils.BeanCopyUtils;
import com.briup.estore.vo.AddressVO;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;


@Service
public class AddressService {
    @Resource
    private AddressMapper addressMapper;

    public List<AddressVO> address(String userId) {
        List<AddressVO> address = addressMapper.address(userId);
        return address;
    }


    public List<AddressVO> findAddresses(Integer userId) {
        List<AddressExtend> list = addressMapper.findByUserId(userId);
        List<AddressVO> vos = BeanCopyUtils.copyBeanList(list,
                AddressVO.class);
        return vos;
    }
}
